package com.zhoug.demo.player.play;

import com.zhoug.player.core.utils.LogUtils;

import java.util.Locale;

/**
 * @author: zhoug
 * @since: 2025-08-13
 */
public class TimePrinter {
    private static final String TAG = ">>>TimePrinter";
    private long _startTime;

    public void start() {
        start(null);
    }

    public void start(String msg) {
        _startTime = System.currentTimeMillis();
        if (msg != null) {
            LogUtils.d(TAG, msg);
        }
    }

    public void print(String tag) {
        float times = (System.currentTimeMillis() - _startTime) / 1000f;
        LogUtils.d(TAG, String.format(Locale.CHINA, "%s,耗时:%2f", tag, times));
    }
}
